package com.oneonefive.trainticketsystem.service.impl;

import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.oneonefive.trainticketsystem.mapper.TrainMapper;
import com.oneonefive.trainticketsystem.pojo.Train;
import com.oneonefive.trainticketsystem.service.TrainService;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class TrainServiceImpl extends ServiceImpl<TrainMapper, Train>
    implements TrainService {

    final
    TrainMapper trainMapper;

    public TrainServiceImpl(TrainMapper trainMapper) {
        this.trainMapper = trainMapper;
    }

    @Override
    public List<Train> selectAllTrain(Integer trainId,String startLocation, String endLocation, int startRow) {
        return trainMapper.selectAllTrain(trainId,startLocation,endLocation,startRow);
    }

    @Override
    public int getRowCount(Integer trainId,String startLocation, String endLocation) {
        return trainMapper.getRowCount(trainId, startLocation, endLocation);
    }
}




